import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/index'
import Blog from "../views/Blog"
import Resume from "../views/Resume"
import messageBoard from "../views/messageBoard"
import Write from "../views/Write"
import Read from "../views/Read"
import Case from "../views/case"
import Introduce from "../views/Introduce";

Vue.use(VueRouter)

const routes = [{
  path: '/index',
  component: Index,
  children: [{
    path: '/',
    redirect: '/blog'
  }, {
    path: '/blog',
    component: Blog,
  }, {
    path: '/resume',
    component: Resume,
  }, {
    path: '/messageboard',
    component: messageBoard,
  }, {
    path: '/write',
    component: Write,
  }, {
    path: '/read',
    component: Read,
  }, {
    path: '/case',
    component: Case
  }, {
    path: '/introduce',
    component: Introduce
  }]
}, {
  path: '/',
  redirect: '/index'
}]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
